package com.apollo.test.web;

import com.apollo.test.JavaConfigBean;
import com.apollo.test.service.FlowService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class IndexController {

    @Autowired
    private JavaConfigBean javaConfigBean;

    @Autowired
    private FlowService flowService;

    @RequestMapping("/index")
    public String index() {
        log.info(String.valueOf(javaConfigBean.getTimeout()));
        log.info(javaConfigBean.getNewKey());
        return "index";
    }

    @RequestMapping("/test")
    public String test() {
        return flowService.test();
    }

}
